package com.asiainfo.lop;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.GridView;

import com.asiainfo.lop.os.InitParam;

/**
 * 解决在scrollview中只显示第一行数据的问题
 */
public class MyselfGridView extends GridView {
    public MyselfGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyselfGridView(Context context) {
        super(context);
    }

    public MyselfGridView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        Log.d(InitParam.TAG, "onMeasure: "+expandSpec);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }

}
